<%@ page import="swe.article.*"%>

<jsp:include page="layout/header.jsp" />

<% 

if(session.getAttribute("isLoggedIn") == null || (Boolean) session.getAttribute("isLoggedIn") == false) { 

	RequestDispatcher view = request.getRequestDispatcher("login.jsp");
	view.forward(request, response);
	
 } %>
<h2>Artikel einstellen</h2>

<div class="row-fluid">
	<div class="span12">
		<form action="Article?action=new" method="post" accept-charset="utf-8" class="form-horizontal">
			<div class="control-group">
				<label for="category" class="control-label">Kategorie w&auml;hlen</label>
				<div class="controls">
					<select name="category">
						<% for(Category c: Category.getCategories()) { %>
					          <option value="<%= c.getId() %>"><%= c.getName() %></option>  
			         	<% } %>
					</select>
				</div>
			</div>
			<div class="control-group">
				<label for="name" class="control-label">Titel</label>
				<div class="controls">
					<input type="text" id="name" class="input-xxlarge" name="title" value="Ferrari F<%= Math.round(Math.random()) %>"/>
				</div>
			</div>

			<div class="control-group">
				<label for="name" class="control-label">Beschreibung</label>
				<div class="controls">
					<textarea rows="5" class="input-xxlarge" name="description" cols="">
					A wonderful serenity has taken possession of my entire soul, like these sweet mornings of spring which I enjoy with my whole heart.  When, while the lovely valley 
					</textarea>
				</div>
			</div>
			
			<div class="control-group">
				<label for="name" class="control-label">Bild-URL</label>
				<div class="controls">
					<input type="text" id="image" value="http://www.abload.de/img/dubai-ferrari-f40-1r6xaf.jpg" class="input-xxlarge" name="image" /><br />
					http://www.abload.de/img/volkswagen-passat-varqcrb9.jpg<br />
					http://www.abload.de/img/polizia_by_lamborghinlcu1e.jpg
				</div>
				
			</div>
			
			<div class="control-group">
				<label for="name" class="control-label">Typ</label>
				<div class="controls">
					<label class="radio"> <input type="radio"
						name="articleType" id="optionsRadios1" value="auction" checked>
						Auktion
					</label> <label class="radio"> <input type="radio"
						name="articleType" id="optionsRadios2" value="buy">
						Sofortkauf
					</label>
				</div>
			</div>

			<div class="control-group">
				<label for="name" class="control-label">Startpreis / Sofort-Kauf Preis</label>
				<div class="controls">
					<input type="text" id="name" value="5999" class="input-small" name="startprice" />
				</div>
			</div>
			<div class="control-group">
				<label for="name" class="control-label">Laufzeit w&auml;hlen</label>
				<div class="controls">
					<select name="runningTime">
					<!--  <input type="text" id="name" value="7" class="input-small" name="runningTime" />-->
						<option value="300000">5 Minuten</option>
						<option value="602000000">7 Tage</option>
						<option value="1204000000">14 Tage</option>
					</select>
				</div>
			</div>
			
			
			<div class="form-actions">
				<button class="btn btn-primary" type="submit" value="Login"
					id="login-button">Speichern</button>

				<div class="loading"></div>
			</div>
		</form>
	</div>
</div>


<jsp:include page="layout/footer.jsp" />
